import { createRouter, createWebHistory } from 'vue-router'
import user from '@/views/user/Home.vue'
import page from '@/views/user/page.vue'
import compile from '@/views/user/compile.vue'
import article from '@/views/user/article.vue'
import essay from '@/views/user/essay.vue'
import essayHome from '@/views/user/essayHome.vue'
const router = createRouter({
  history: createWebHistory(),
  routes: [
    { path: '/', redirect: '/user/page' },
    {
      path: '/user',
      name: 'user',
      component: user,
      children: [
        {
          path: 'page',
          name: 'page',
          component: page,
        },
        {
          path: '/essayHome/:id',
          name: 'essayHome',
          component: essayHome,
          props: true
        },
        {
          path: 'compile',
          name: 'compile',
          component: compile
        },
        {
          path: 'article',
          name: 'article',
          component: article
        },
        {
          name: 'essay', path: 'essay', component: essay
        }
      ]
    },
  ],
})

export default router
